package com.ww.scm.repository.mat;

import java.util.Date;

import org.springframework.stereotype.Component;

import com.ww.core.orm.hibernate.HibernateDao;
import com.ww.core.utils.DateUtils;
import com.ww.scm.constants.Constants;
import com.ww.scm.entity.mat.Transaction;

//Spring Bean的标识.
@Component
public class TransactionRepository extends HibernateDao<Transaction, String>{

	public void delete(Transaction transaction,String operator) {
		Date nowDate=new Date();
		transaction.setSysFlag(Constants.SYS_FLAG_DELETED);
		transaction.setLastModifier(operator);
		transaction.setLastModifiedTime(DateUtils.formatDateHms(nowDate));
		save(transaction);
	}
	
	public void delete(String id,String operator) {
		Transaction transaction=get(id);
		delete(transaction, operator);
	}
	
}
